package com.lagou.service.impl;

import com.lagou.entity.User;
import com.lagou.mapper.UserMapper;
import com.lagou.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;

/**
 *
 */
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public void updateUser(Integer userid, String newName, String imgfileId) {

        User user = new User();
        user.setId(userid);
        user.setName(newName);
        user.setPortrait(imgfileId);
        userMapper.updateById(user);
    }

    @Override
    public void updatePassword(Integer userid, String newPwd) {

        System.out.println(newPwd);
        User user = new User();
        user.setId(userid);
        user.setPassword(newPwd);
        userMapper.updateById(user);
    }
}
